function collision(obj1,obj2){
    var l1 = obj1.offsetLeft;
    var r1 = obj1.offsetLeft + obj1.offsetWidth;
    var t1 = obj1.offsetTop;
    var b1 = obj1.offsetTop + obj1.offsetHeight;
    var l2 = obj2.offsetLeft;
    var r2 = obj2.offsetLeft + obj2.offsetWidth;
    var t2 = obj2.offsetTop;
    var b2 = obj2.offsetTop + obj2.offsetHeight;
    if (r1 < l2 || l1 > r2 || b1 < t2 || t1 > b2) {
        return false;
    }
    else {
        return true;
    }
}


// 封装：时间
function getTime(){
	var now = new Date();
	// 年	月	日
	var year = now.getFullYear();
	var month = now.getMonth() + 1;
	var day = now.getDate();
	// 时  分   秒
	var hour = now.getHours();
	var minute = now.getMinutes();
	var second = now.getSeconds();
	// 不够两位，补0
	return year + "-" + month + "-" + day + " " + [hour,minute,second].map(function(ele){
		return (ele + "")[1] ? (ele + "") : ("0" + ele);
	}).join(":");
}


